<?php
//print_r($_GET);die;//Array ( [cid] => 1 )
include_once("./function.php");
if(isset($_GET["cid"]))
{
extract($_GET);//$cid
//3判断该分类是否有子类
$sql="select * from  ts_news_cate where fid='$cid'";
$res=mysqli_query($link,$sql);
if(is_object($res))
{
	if(mysqli_num_rows($res)>0)
	{
		msg("该分类有子分类，不能删除","news_conf.php");exit;
	}
}
//删除分类
$sql="delete from ts_news_cate where cid='$cid'";
$res=mysqli_query($link,$sql);
if($res)
{
	if(mysqli_affected_rows($link)==1)
	{
		msg("删除成功","news_conf.php");exit;
	}
	else
	{
		msg("删除失败","news_conf.php");exit;
	}
}
else
{
	echo "错误码:".mysqli_errno($link)."错误信息:".mysqli_error($link);exit;
}
}

?>